package org.example.memorystream;

import java.io.CharArrayReader;
import java.io.CharArrayWriter;
import java.io.IOException;

public class CharArrayWriter1 {

    public static void main(String[] args) throws IOException {

        //写入内存
        CharArrayWriter charArrayWriter = new CharArrayWriter();
        charArrayWriter.write(1);


        //读出来
        CharArrayReader charArrayReader = new CharArrayReader(charArrayWriter.toCharArray());
        int read = charArrayReader.read();
        System.out.println(read);

    }
}
